package com.example.esredisrabbitmqdemo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @BelongsProject: es-redis-rabbitmq-demo
 * @BelongsPackage: com.example.esredisrabbitmqdemo.pojo
 * @Author: 江岸
 * @CreateTime: 2020-07-04 11:59
 * @Description:
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "mydoc")  //es的索引 对应于mysql中的数据库
public class User  implements Serializable {
    @Id
    private Integer id;
    @Field(type = FieldType.Text) //给es的注解，告诉数据类型
    private String username;
    @Field(type = FieldType.Text)
    private String password;
}
